package com.ruoyi.lightkillPest.mapper;

import com.ruoyi.lightkillPest.domain.device.LightKillPestDeviceInfo;
import com.ruoyi.lightkillPest.domain.device.SCDDeviceBatteryInfo;
import com.ruoyi.lightkillPest.domain.device.SCDDeviceDao;
import com.ruoyi.lightkillPest.domain.device.SelectSCDDeviceDao;
import org.mapstruct.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface SCDDeviceMapper {

    /**
     * 更新设备信息
     * @param scdDeviceDao
     * @return
     */
    int updateSCDDeviceInfo(SCDDeviceDao scdDeviceDao);

    /**
     * 插入设备
     * @param scdDeviceDao
     * @return
     */
    int insertSCDDevice(SCDDeviceDao scdDeviceDao);


    SCDDeviceDao selectSCDDeviceInfo(String deviceId);

    List<SCDDeviceDao> selectAllDeviceInfo();

    List<SCDDeviceDao> selectDeviceInfoByCondition(SCDDeviceDao scdDeviceDao);

    /**
     * 根据设备编号更新设备昵称
     * @param scdDeviceDao
     * @return
     */
    int updateNickName(SCDDeviceDao scdDeviceDao);

    /**
     * 插入电量历史信息
     * @param scdDeviceBatteryInfo
     * @return
     */
    int insertBatteryInfo(SCDDeviceBatteryInfo scdDeviceBatteryInfo);

    /**
     * 查询电量历史信息
     * @param deviceId
     * @return
     */
    List<SCDDeviceBatteryInfo> selectBatteryInfoListByDeviceId(String deviceId);
}
